package com.dawn.module.hospital.controller.app.selfservice;

import com.dawn.framework.apisign.core.annotation.Sign;
import com.dawn.framework.common.pojo.CommonResult;
import com.dawn.module.hospital.controller.app.selfservice.vo.SelfServiceOpenReqVO;
import com.dawn.module.hospital.service.SelfServiceService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @description:
 * @author: cnsu-cmh
 * @time: 2024/8/7 13:45
 */
@Tag(name = "自助服务 APP - bh")
@RestController
@RequestMapping("/bh/self-service")
@Validated
public class AppSelfServiceController {

    @Autowired
    private SelfServiceService selfServiceService;

    @Sign
    @PostMapping(value = "/open/driver")
    @Operation(summary = "驾驶员体检自助开单")
    public CommonResult openDriver(@Valid @RequestBody SelfServiceOpenReqVO reqVO){
        reqVO.setOpenType("driver");
        return selfServiceService.open(reqVO);
    }

}
